//
//  UIView_extra.h
//  Woyoli
//
//  Created by jamie on 14-11-25.
//  Copyright (c) 2014年 Missionsky. All rights reserved.
//

#define vAlertTag    10086

#import <UIKit/UIKit.h>

#define UIScreenWidth  ((int)[UIScreen mainScreen].bounds.size.width)
#define UIScreenHeight ((int)[UIScreen mainScreen].bounds.size.height)

#define XAviewWidth [UIScreen mainScreen].bounds.size.width
#define XAviewHeight [UIScreen mainScreen].bounds.size.height
#define XAratio [UIScreen mainScreen].bounds.size.width/375
#define XAHratio [UIScreen mainScreen].bounds.size.height/667
#define Kratio [UIScreen mainScreen].bounds.size.width/375
#define KHratio [UIScreen mainScreen].bounds.size.height/667

#define KviewWidth [UIScreen mainScreen].bounds.size.width
#define KviewHeight [UIScreen mainScreen].bounds.size.height

#define SizeScale ((SCREEN_HEIGHT > 568) ? SCREEN_HEIGHT/568 : 1)




@interface UIView (UIView)

@property (nonatomic, assign) CGFloat   x;
@property (nonatomic, assign) CGFloat   y;
@property (nonatomic, assign) CGFloat   width;
@property (nonatomic, assign) CGFloat   height;
@property (nonatomic, assign) CGPoint   origin;
@property (nonatomic, assign) CGSize    size;
@property (nonatomic, assign) CGFloat   bottom;
@property (nonatomic, assign) CGFloat   right;
@property (nonatomic, assign) CGFloat   centerX;
@property (nonatomic, assign) CGFloat   centerY;
@property (nonatomic, strong, readonly) UIView *lastSubviewOnX;
@property (nonatomic, strong, readonly) UIView *lastSubviewOnY;
@property (nonatomic, assign) BOOL  hasShadow;

/**
 * @brief 移除此view上的所有子视图
 */
- (void)removeAllSubviews;

-(NSMutableAttributedString *)getAttribute:(NSString *)subStr1
                                    color1:(UIColor *)color1
                                  fontSize1:(CGFloat)size1
                                 subString:(NSString *)subStr2
                                    color2:(UIColor *)color2
                                  fontSize2:(CGFloat)size2;
- (void)setShadowAndCornerWithCornerRadius:(CGFloat)cornerRadius
                              shadowRadius:(CGFloat)shadowRadius
                               shadowColor:(UIColor *)shadowColor
                              shadowOffset:(CGSize )offset
                             shadowOpacity:(CGFloat)opacity
                               borderWidth:(CGFloat)borderWidth
                               borderColor:(UIColor *)borderColor;
@end
